package com.lcf.framework.model.sms;

import com.lcf.framework.config.sms.SmsConfig;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

import static com.lcf.framework.constant.SysConstant.INTERNATIONAL_CODE_CN;
import static com.lcf.framework.constant.SysConstant.TENCENT_SMS_REGION;

/**
 * 短信请求参数
 *
 * @author lcf
 */
@Data
@NoArgsConstructor
public class SmsReq {
    /**
     * 应用id
     */
    private String appId;
    /**
     * secretId
     */
    private String secretId;
    /**
     * secretKey
     */
    private String secretKey;
    /**
     * 地域
     */
    private String region = TENCENT_SMS_REGION;
    /**
     * 国际码
     */
    private String internationalCode = INTERNATIONAL_CODE_CN;
    /**
     * 签名
     */
    private String signName;
    /**
     * 模板id
     */
    private String templateId;
    /**
     * 模板参数
     */
    private List<String> templateParam;
    /**
     * 电话
     */
    private List<String> phone;

    public SmsReq(SmsConfig smsConfig, String templateId) {
        this.appId = smsConfig.getAppId();
        this.secretId = smsConfig.getSecretId();
        this.secretKey = smsConfig.getSecretKey();
        this.signName = smsConfig.getSignName();
        this.templateId = templateId;
    }

    public SmsReq(SmsConfig smsConfig, String templateId, List<String> templateParam, List<String> phone) {
        this(smsConfig, templateId);
        this.templateParam = templateParam;
        this.phone = phone;
    }
}
